package com.education.dao;

import java.util.List;

import com.education.model.ResourceTCModel;
import com.education.model.StudyResModel;
import com.education.model.StudyResourceModel;
import org.apache.ibatis.annotations.Param;

/**
 * 导学资源的数据层
 * @author 申忠正
 *
 */
public interface StudyResourceDao {
    /**
     * 
     * @return List<StudyResourceModel> 导学资源 --查询所有记录到页面
     * @throws Exception 抛出数据层异常
     */
    List<ResourceTCModel> selectStudyResource(ResourceTCModel resourceTCModel)throws Exception;
    
    /**
     * @param sr 对象
     * 2017/8/11 修改 by 雷紫辉 修改入参对象
     * @return int 影响的行数
     * @throws Exception
     */
    int addStudyResource(StudyResModel sr)throws Exception;
    /**
     * @param resourceId
     * @return int 影响的行数
     * @throws Exception
     */
    int deleteResource(int resourceId) throws Exception;
    /**
     * 根据id查询
     * 2017/8/12 修改返回实体类型 by 雷紫辉
     * @param resourceId 传入资源id
     * @return 返回一个 资源对象
     * @throws Exception
     */
    StudyResModel queryResById(int resourceId) throws Exception;


    /**
     * 更新资料信息
     * 2017/8/13 修改参数为新实体类  by 雷紫辉
     * @param studyResModel 实体
     * @return int 影响的行数
     * @throws Exception
     */
    int updateResource(StudyResModel studyResModel) throws Exception;


    /**
     * 通过教师Id查询其发布的资料信息
     * @param teacherId
     * @return
     */
    List<StudyResModel> getStudyResByTeacherId(@Param("teacherId") Integer teacherId);
}